<template>
	<view>
		<view class="signli" v-for="item in list" :key="item.id">
			<view class="signtop">
				<image :src=" item.staff.img ? item.staff.img : BASE_IMG_URL+'headImg.png'" class="headimg"  mode="scaleToFill"></image>
				<view class="info">
					<view class="infotop">
						<view class="name">{{item.staff.name}}</view>
						<view class="time">{{item.createtime}}</view>
					</view>
					<view class="address">{{item.location}}</view>
				</view>
			</view>
			<view class="remark">备注：{{item.content}}</view>
			<view class="kehu">
				<view>拜访客户：</view>
				<view class="kehuinfo" @click="toMore(item.customer.id)">
					{{item.customer.name}}
				</view>
			</view>
			<view class="fujian">
				附件：
				<view class="imgbox">
					<image 
						:src="ele" 
						class="fujianimg" 
						v-for="(ele,index) in item.file_ids" 
						:key="index" 
						 mode="scaleToFill"
						@click="toPrevieimg(item.file_ids)"
					></image>
				</view>
			</view>
		</view>
		
<view style="height: 200rpx;"></view>
		<u-empty v-if="list.length == 0" text="暂无更多"></u-empty>
	</view>
</template>

<script>
	import { netGetSignList } from '@/api/index.js'
	import { BASE_IMG_URL } from '@/util/api.js'
	export default{
		data() {
			return {
				list:[],
				BASE_IMG_URL:BASE_IMG_URL,
			}
		},
		onShow() {
			this.getList()
		},
		methods:{
			getList() {
				netGetSignList().then(res=>{
					this.list = res.data
				})
			},
			toPrevieimg(files) {
				uni.previewImage({
					urls: files
				})
			},
			toMore(id) {
				uni.navigateTo({
					url: '/pages/index/groupCompany/groupCompany?id='+id
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
	.signli{
		padding:20rpx;
		background:#fff;
		border-radius: 10rpx;
		margin-bottom:20rpx;
		.signtop{
			display: flex;
			justify-content: flex-start;
			align-items: center;
			.headimg{
				width:80rpx;
				height:80rpx;
				border-radius: 50%;
			}
			.info{
				margin-left:15rpx;
				.infotop{
					display: flex;
					justify-content: flex-start;
					align-items: center;
					.name{
						font-size:26rpx;
						color:#333;
					}
					.time{
						font-size:24rpx;
						color:#999;
						margin-left:10rpx;
					}
				}
				.address{
					font-size:24rpx;
					color:#666;
					margin-top:15rpx;
				}
			}
		}
		.remark{
			padding:20rpx;
			font-size:24rpx;
			line-height: 32rpx;
		}
		.kehu{
			display: flex;
			justify-content: flex-start;
			align-items: center;
			font-size:24rpx;
			padding:0 20rpx;
			color:#666;
			.kehuinfo{
				font-size:24rpx;
				color:#03aa96;
			}
		}
	}
	.fujian{
		font-size:24rpx;
		color:#333;
		padding:0 20rpx;
		margin-top:20rpx;
		.imgbox{
			display: flex;
			justify-content: flex-start;
			align-items: center;
			margin-top:15rpx;
		}
		.fujianimg{
			width:120rpx;
			height:120rpx;
			margin-right:15rpx;
		}
	}
</style>
